import java.util.Arrays;

public class Homework3 {

	public static void main(String[] args) {
		int[] nums = { 10, 20, 11, 35, 6, 89 };
		int temp = 0;
		System.out.println("排序前：");
		System.out.println(Arrays.toString(nums));

		for (int i = 0; i < nums.length - 1; i++) {
			System.out.println("外层循环第" + (i + 1) + "趟");
			for (int j = 0; j < nums.length - i - 1; j++) {

				if (nums[j] > nums[j + 1]) {
					temp = nums[j];
					nums[j] = nums[j + 1];
					nums[j + 1] = temp;

				}
				System.out.println("\t内层循环第 " + (j + 1) + "次" + Arrays.toString(nums));
			}

		}
		System.out.println("排序后");
		System.out.println(Arrays.toString(nums));

	}

}
